<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加一位行政人员信息</title>
<!--控件布局方式-->
<style type="text/css" media="all">
    .allow-float {clear:none!important;} /* 允许该元素浮动 */
    .stop-float {clear:both!important;} /* 阻止该元素浮动 */
	.float-left {float:left;padding-left:5px}   /*浮动到左边*/
  </style>
<script type="text/javascript">
		Ext.onReady(function(){

		var sexdatas=[{id:'男',name:'男'},{id:'女',name:'女'}];

		var sexstore=new Ext.data.JsonStore({ data:sexdatas,fields:["id","name"]});

		var agreementdata=[{id:'0',name:'没有签订聘用合同'},{id:'1',name:'签订了聘用合同'}];

		var pracAgreementStore=new Ext.data.JsonStore({ data:agreementdata,fields:["id","name"]});

		var popedomdatas=[{id:'01',name:'系统管理员'},{id:'02',name:'老板'},{id:'03',name:'律师'}];

		var popedomstore=new Ext.data.JsonStore({data:popedomdatas,fields:["id","name"]});


		var addAdminPersonInfoWin=new Ext.form.FormPanel({
			title:'添加一位行政人员信息',
			buttonAlign:'center',
			labelSeparator :'：',//分隔符
			labelWidth : 100,//标签宽度
			bodyStyle:'padding:5',//表单边距
			frame : true,
			collapsible: true,
			height:300,
			width:window.screen.width-320,
			applyTo :'AdminPersonInfo',
			defaults : {
            width : 230
        },
        defaultType : 'textfield',
        items : [
        {
            fieldLabel : '行政人员姓名',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'aadminpersonname',
            id :'aadminpersonname',
            allowBlank :false
        },
        {
        	xtype:'datefield',
        	format:'Y-m-d',
            fieldLabel :'出生年月',
			id :'aadminbirthtime',
			name :'aadminbirthtime',
			itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
			allowBlank :true
        },
        new Ext.form.ComboBox({
			fieldLabel:'请选择性别',
			itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
			store:sexstore,
			valueField:'id',
			displayField:'name',
			mode:'local',
			forceSelection:true,
			emptyText:'请选择性别',
			hiddenName:'sex',
			editable:false,
			triggerAction:'all',
			id:'aadminsex',
			name:'aadminsex'
			}),
        {
            fieldLabel : '政治面貌',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'aadminpoliticalstatus',
            id:"aadminpoliticalstatus",
            allowBlank : false
        },
        {
            fieldLabel : '文化程度',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'aadmineducationallevel',
            id:"aadmineducationallevel",
            allowBlank : false
        },
        {
            fieldLabel : '毕业院校',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'aadmingraduateschool',
            id:"aadmingraduateschool",
            allowBlank : false
        },
         {
            fieldLabel : '联系方式',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'aadminphone',
            id:"aadminphone",
            allowBlank : false
        },

         {
            fieldLabel : '身份证号',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'aadminidentitynumber',
            id:"aadminidentitynumber",
            allowBlank : false
        },
         {
            fieldLabel : '邮箱',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'aadminemail',
            id:"aadminemail",
            allowBlank : false
        },

         {
            fieldLabel : '职位',
            itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
            name :'aadminposition',
            id:"aadminposition",
            allowBlank : false
        },

		new Ext.form.ComboBox({
			fieldLabel:'是否签订聘用合同',
			itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
			store:pracAgreementStore,
			valueField:'id',
			mode:'local',
			displayField:'name',
			forceSelection:true,
			emptyText:'请选择是否签订了聘用合同',
			hiddenName:'adminagreement',
			editable:false,
			triggerAction:'all',
			id:'aadminagreement',
			name:'aadminagreement'
			}),

          new Ext.form.ComboBox({
			fieldLabel:'请选择权限',
			itemCls:'float-left',//向左浮动
			clearCls:'allow-float',//允许浮动
			store:popedomstore,
			valueField:'id',
			displayField:'name',
			mode:'local',
			forceSelection:true,
			emptyText:'请选择权限',
			hiddenName:'adminpopedom',
			editable:false,
			triggerAction:'all',
			id:'aadminpopedom',
			name:'aadminpopedom'
			})
        ],

        buttons : [ {
            text : '添加',
			iconCls:'useradd',
            disabled : false,
            handler : function() {
               if (addAdminPersonInfoWin.form.isValid()) {
                    addAdminPersonInfoWin.form.submit( {
                        url : 'AddAdminPersonInfo.jsj',
                        success : function(from, action) {
                        Ext.MessageBox.alert('结果', action.result.message);
                        },
                        failure : function(form, action) {
                           Ext.MessageBox.alert('结果', action.result.message);
                        },
                        waitMsg : '正在保存数据，稍后...'
                    });
                } else {
                    Ext.Msg.alert('信息', '请填写完成再提交!');
                }
            }
        }
        ]
		})
	})

</script>
</head>
<body>
<table>
	<tr>
		<td>
		<div id='AdminPersonInfo' style="margin: 8px 8px 4px 8px"></div>
		</td>
	</tr>
</table>
</body>
</html>